<%@page import="${basepackage}.domain.*" %>
<#assign className = table.className />
<#assign classNameLowerCase = className?lower_case />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="m" uri="/mytags" %>
	<head>
		<title></title>
		<link href="/css/page/front/org_styles.css" rel="stylesheet" type="text/css" />
		<link href="/css/base/reset.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="/css/base/table_org.css"/>
		<script type="text/javascript" src="/js/base/jquery-1.10.2.js"></script>
		<script type="text/javascript" src="/js/compont/My97DatePicker/WdatePicker.js"></script>

		<script src="/js/base/require.min.js"></script>
		<script type="text/javascript">
			var oTable;
			require.config({
				paths: {
					"require-config":"/js/base/require.config"
				}
			});

			require(["require-config"],function (){
				require(["mytable"],function () {
					$(function() {
						oTable = $("#dataTable").MyTable({
							ajax:{
								url:"${r"${controllerUrlPrefix}"}/search.do",
								paramForm:"searchForm",
								dataMaper:{
									data:function(data) {

										data.data = data.content[0].records;
									},
									recordsTotal:function(data) {
										data.recordsTotal = data.content[0].totalRecords;
									}
								}
							},
							"columns": [
						<#list table.notPkColumns as column>
							<#if (column.extColumnMetaData.show)!false>

								{ "data": "<%=${className}.ALIAS_${column.constantName}%>" },
							</#if>
						</#list>

							],
							renderCell:function(row, cell, data) {
								if(cell.index==row.cellsLength - 1){
									cell.jdom.html('<m:permissionA href="${r"${controllerUrlPrefix}"}/editUI.do?id='+data.id+'" module="role" moduleFunction="edit" title="编辑" />');
								}
							}
						});
						document.onkeydown = function(e) {
							var ev = document.all ? window.event : e;
							if (ev.keyCode == 13) {

								oTable.ajax.reload();
							}
						};
						$("#searchBtn").click(function () {
							oTable.ajax.reload();
						});
					});
				});
			});
			function msg(){
				if(confirm("确定要删除？")==false){
					return false;
				}
			}

		</script>


	</head>

	<body style="background-color:#FFF;">
	<div class="wrapper" style="float: left;">

		<div class="asideR floatL mt10" >
			<div class="main">
				<form id="searchForm" action="${r"${controllerUrlPrefix}"}/search.do" method="post" onkeydown="if(event.keyCode==13){return false;}">
					<div class="search_bar">
						<%--条件栏--%>
						<#list table.notPkColumns as column>
							<#if (column.extColumnMetaData.searchCond)!false>
								<#if column.isRangeType>
									<#if column.isDateTimeColumn>
										<label>${column.remarks}：</label>
										<input type="text" name="<%=${className}.ALIAS_${column.constantName}%>Begin" onclick="WdatePicker()"/>-
										<input type="text" name="<%=${className}.ALIAS_${column.constantName}%>End" onclick="WdatePicker()"/>
									<#else>
										<label>${column.remarks}：</label>
										<input type="text" name="<%=${className}.ALIAS_${column.constantName}%>Min"/>-
										<input type="text" name="<%=${className}.ALIAS_${column.constantName}%>Max"/>
									</#if>
								<#else>
									<label>${column.remarks}：</label>
									<input type="text" name="<%=${className}.ALIAS_${column.constantName}%>"/>
								</#if>
							</#if>
						</#list>
						<a  class="search_button" id="searchBtn" ></a>
						<div class="login_out">
							<m:permissionA href="${r"${controllerUrlPrefix}"}/addRoleUI.do" module="role" moduleFunction="add" cssClass="add_button" />
							<a href="<%=request.getContextPath() %>/abroad/admin/sysRoleManage_list" class="account_button"></a>
							<a href="<%=request.getContextPath() %>/abroad/admin/abroadCollegeManage_login" class="exit_button"></a>
						</div>
					</div>
				</form>


				<div style="background-color:#FFF;" class="mt15 mb25">
					<table class="tDefault tablewidth tCenter dataTable mb10" id="dataTable">
						<thead>
							<tr>
							<#list table.notPkColumns as column>
								<#if (column.extColumnMetaData.show)!false>
									<th class="sorting" align="center">${column.remarks}</th>
								</#if>
							</#list>
							<th class="sorting" align="center"></th>
							</tr>
						</thead>
					</table>
				</div>

			</div>
		</div>

	</div>

	</div>

	</body>
	</html>
